package com.kaifamiao.service.Impl;

import com.kaifamiao.mapper.OrderModelMapper;
import com.kaifamiao.model.OrderModel;
import com.kaifamiao.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service()
@Transactional(propagation = Propagation.REQUIRED)
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderModelMapper mapper;

    @Override
    public int insertOrder(int fno, String rno, int sno) {
        return mapper.insertOrder(fno, rno, sno);
    }

    @Override
    public OrderModel selectById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public int selectOId(int fno, String rno, int sno) {
        return mapper.selectOId(fno, rno, sno);
    }

    @Override
    public List<OrderModel> allSelectedSeats(int fno, String rno) {
        return mapper.allSelectedSeats(fno,rno);
    }

    @Override
    public int deleteOrder(Integer id) {
        return mapper.deleteOrder(id);
    }
}
